import request from '@/config/axios'

// 企业管理
export const getCompanyPage = async (params) => {
  return await request.getMST({
    url: '/gvCompany/getPage',
    params
  })
}

export const getCompanyList = async (params) => {
  return await request.getMST({
    url: '/gvCompany/getList',
    params
  })
}

export const getCompanyById = async (params) => {
  return await request.getMST({
    url: '/gvCompany/getById',
    params
  })
}

export const createCompanyInfo = async (data) => {
  return await request.postMST({
    url: '/gvCompany/create',
    data
  })
}

export const updateCompanyInfo = async (data) => {
  return await request.putMST({
    url: '/gvCompany/update',
    data
  })
}

// 煤种管理
export const getCollieryMgrPage = async (params) => {
  return await request.getMST({
    url: '/gvCollieryMgr/getPage',
    params
  })
}

export const getCollieryMgrList = async (params) => {
  return await request.getMST({
    url: '/gvCollieryMgr/getList',
    params
  })
}

export const getCollieryMgrById = async (params) => {
  return await request.getMST({
    url: '/gvCollieryMgr/getById',
    params
  })
}

export const createCollieryInfo = async (data) => {
  return await request.postMST({
    url: '/gvCollieryMgr/create',
    data
  })
}

export const updateCollieryInfo = async (data) => {
  return await request.putMST({
    url: '/gvCollieryMgr/update',
    data
  })
}

export const getCoalPriceTaskPage = async (params) => {
  return await request.getMST({
    url: '/gvCoalPriceTask/page',
    params
  })
}

// 煤种价格管理
export const getPriceMgrPage = async (params) => {
  return await request.getMST({
    url: '/gvPriceMgr/getPage',
    params
  })
}

export const getPriceMgrById = async (params) => {
  return await request.getMST({
    url: '/gvPriceMgr/getById',
    params
  })
}

export const createPriceMgrInfo = async (data) => {
  return await request.postMST({
    url: '/gvPriceMgr/create',
    data
  })
}

export const updatePriceMgrInfo = async (data) => {
  return await request.putMST({
    url: '/gvPriceMgr/update',
    data
  })
}

export const deletePriceMgrInfo = async (params) => {
  return await request.deleteMST({
    url: '/gvPriceMgr/delete',
    params
  })
}

// 煤种销量管理
export const getSalesMgrPage = async (params) => {
  return await request.getMST({
    url: '/gvSalesMgr/getPage',
    params
  })
}

export const getSalesMgrDailyPage = async (params) => {
  return await request.getMST({
    url: '/gvSalesMgr/getDailyPage',
    params
  })
}

// 运单管理
export const getSellPage = async (params) => {
  return await request.getMST({
    url: '/gvOrder/getSellPage',
    params
  })
}

export const getPurchasePage = async (params) => {
  return await request.getMST({
    url: '/gvOrder/getPurchasePage',
    params
  })
}

// 煤种收藏
export const getCoalCollectPage = async (params) => {
  return await request.getMST({
    url: '/gvCoalCollect/getPage',
    params
  })
}

// 排队数据管理
export const getQueueMgrPage = async (params) => {
  return await request.getMST({
    url: '/gvQueueMgr/getPage',
    params
  })
}

// 短倒价格配置
export const getShortPriceSettingPage = async (params) => {
  return await request.getMST({
    url: '/gvShortPriceSetting/getPage',
    params
  })
}

export const getShortPriceSettingById = async (params) => {
  return await request.getMST({
    url: '/gvShortPriceSetting/getById',
    params
  })
}

export const createShortPriceSettingInfo = async (data) => {
  return await request.postMST({
    url: '/gvShortPriceSetting/create',
    data
  })
}

export const updateShortPriceSettingInfo = async (data) => {
  return await request.putMST({
    url: '/gvShortPriceSetting/update',
    data
  })
}

export const deleteShortPriceSettingInfo = async (params) => {
  return await request.deleteMST({
    url: '/gvShortPriceSetting/delete',
    params
  })
}

// 用户管理绑定小程序
export const getQrcode = async (params) => {
  return await request.getBlob({
    url: '/applet/getQrcode',
    responseType: 'blob',
    headersType: 'image/png',
    params
  })
}

export const untieQrCode = async (data) => {
  return await request.put({
    url: '/system/user/untieQrCode',
    data
  })
}

export const getMessageRecordPage = async (params) => {
  return await request.getMST({
    url: '/gvMessageRecord/page',
    params
  })
}

export const getCoalByCompanyId = async (params) => {
  return await request.getMST({
    url: '/gvCollieryMgr/getByCompanyId',
    params
  })
}

export const getAreaByCode = async (params) => {
  return await request.get({
    url: '/system/area/getAreaByCode',
    params
  })
}

export const exportCollieryMgrExcel = async (params) => {
  return await request.downloadMST({
    url: '/gvCollieryMgr/export-excel',
    params
  })
}

export const importCollieryMgrExcel = async (params) => {
  return await request.getMST({
    url: '/gvCollieryMgr/import',
    params
  })
}
